<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>我要评价</title>
    <style type="text/css">
        .search .search-info{ width:596px; height:40px;}
        .search-info input{ width:494px;}
    </style>
</head>

<body>
<script src="/static/common/js/jquery1.42.min.js" type="text/javascript"></script>
<script src="/static/common/js/common_js.js" type="text/javascript"></script>
<script src="/static/common/js/footer.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/static/con/css/style.css" />
<link rel="stylesheet" type="text/css" href="/static/con/css/shopping-mall-index.css" />
<script type="text/javascript" src="/static/con/js/jquery.js"></script>
<script src="/static/common/js/jquery.SuperSlide.2.1.1.js" type="text/javascript"></script>
<script type="text/javascript" src="/static/con/js/zhonglin.js"></script>
<script type="text/javascript" src="/static/con/js/zhongling2.js"></script>
<script type="text/javascript" src="/static/con/js/jquery.provincesCity.js"></script>
<script type="text/javascript" src="/static/con/js/provincesData.js"></script>
<script type="text/javascript" src="/static/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/static/h-ui.admin/js/H-ui.admin.js"></script>
<link href="/static/common/css/common.css" rel="stylesheet" type="text/css" />
<link href="/static/common/css/style.css" rel="stylesheet" type="text/css" />
<!--header-->


<!--内容开始-->
<input type="hidden" name="orid" value="{$orid}">
{foreach $coInfo as $vo}
<div class="evaluate w1200">


        <input type="hidden" name="coid" value="{$vo.coid}">

        <dl class="eva-info1">
            <dt><a href="#"><img src="{$vo.image}" /></a></dt>
            <dd>
                <h3><a href="#">{$vo.name}</a></h3>
                <ul>
                    <li>
                        <span>价格</span><p class="p1">¥ {$vo.sum} 元</p>
                    </li>
                </ul>
            </dd>
            <div style="clear:both;"></div>
        </dl>
    <div class="eva-info3">
        <div class="eva-if3-l f-l">
            <dl class="if3-l-dl1">
                <dt>商品评价</dt>
                <dd><textarea name="comment"></textarea></dd>
                <div style="clear:both;"></div>
            </dl>

        </div>


        <div style="clear:both;"></div>
    </div>
</div>
{/foreach}
<div class="eva-info3" style="float: right">
    <div class="eva-if3-l f-l">
        <button class="eva-btn" onclick="commentAdd()">提交评价</button>
    </div>

    <div style="clear:both;"></div>
</div>

<!--底部一块-->

<script type="text/javascript" src="/static/con/js/star-rating.js"></script>
<script>

    var coid = [];
    var comment =[];
    var orid = $("input[name='orid']").val();
    function commentAdd() {
        $("input[name='coid']").each(function(){
            coid.push($(this).val());
        });
        $("textarea[name='comment']").each(function(){
            comment.push($(this).val());
        });
        $.ajax({
            type:"post",
            url:"{:url('home/commodity/commentAdd')}",
            dataType: 'json',
            data:{coid:coid,comment:comment,orid:orid},
            success:function (data) {
                if(data.status == -1){
                    layer.msg(data.msg,{icon:2,time:1000});
                    window.location.reload();
                }else{
                    layer.msg(data.msg,{icon:1,time:1000},function () {
                        parent.location.reload();
                    });
                }
            }
        })
    }


</script>
</body>
</html>
